﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace RM.Data
{
    public interface IRespository<T>
    {
        IEnumerable<T> Get(Expression<Func<T, bool>> filter = null,
            Func<IQueryable<T>, IOrderedEnumerable<T>> orderBy = null,
            string includeProperties = "");

        T Single(object primaryKey);

        Dictionary<string,string> GetAuditNames(dynamic dynamicObject);

        T SingleOrDefault(object primaryKey);

        IEnumerable<T> GetAll();

        bool Exists(object primaryKey);

        int Insert(T entity);

        void Update(T entity);

        int Delete(T entity);

        IUnitOfWork UnitOfWork { get; }

        IQueryable<T> Table { get; }
    }
}
